package com.lanou.renrenxin.thread;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

import com.easemob.chat.EMContactManager;
import com.easemob.exceptions.EaseMobException;

import java.util.List;

/**
 * Created by zy on 16/3/5.
 * 异步获取消息类
 */
public class GetUserNameThread extends Thread {
    private Handler handler;

    public GetUserNameThread(Handler handler) {
        this.handler = handler;
    }

    @Override
    public void run() {
        super.run();
        List<String> username = null;
        try {
            username = EMContactManager.getInstance().getContactUserNames();
            Message msg = new Message();
            msg.what = 100;
            msg.obj = username;
            handler.sendMessage(msg);
        } catch (EaseMobException e) {
            e.printStackTrace();
        }
    }



}
